<template>
	<view>
		<view style="margin-top: 10px;">
			<view class="title">{{title}}</view>
			<view class="detail-box">
				<!-- <rich-text :nodes="message"></rich-text> -->
				<mp-html :content="message" />
			</view>
		</view>
	</view>
</template>

<script>
	import mpHtml from '@/components/mp-html/mp-html'
	export default {
		data() {
			return {
				id:'',			//公告ID
				title:'',		//公告标题
				message:'' ,	//公告描述
			}
		},
		onLoad(opt){
			this.id = opt.id
			this.getGonggao()
		},
		methods: {
			getGonggao(){
				this.$http.get('/pp_tongzhi/getTongzhiById',{
					ggid:this.id
				}).then(res => {
					if(res.data.code == 200){
						this.title=res.data.data.title;
						var reg = /\"\/image/g;
						this.message=res.data.data.message.replace(reg,'"'+this.host+'/image');
					}
				})
			}
		},
		components:{
			mpHtml
		}
	}
</script>

<style scoped>
	.title{
		text-align: center;
		color: red;
		font-size: 34rpx;
		font-weight: bold;
		margin-bottom: 10rpx;
	}
	.detail-box .messge img{
		max-width: 100rpx !important;
	}
</style>
